<?php

namespace Console\Controller;

class IndexController extends CstBaseController
{
    private $roleLogic;

    public function _initialize(){
        parent::_initialize();
        $this->roleLogic = A('Console/Role', 'Logic');
    }

    public function index(){
        $userInfo = $this->getUserInfo();
        $role = $userInfo['role'];
        $menuListRes = $this->roleLogic->getMenu($role);
        if (static::$res->isErr($menuListRes)) {
            $this->sysErr($menuListRes['Message']);
        }
        $menuList = $menuListRes['Result'];
        $this->assign("menuList", $menuList);
        $this->assign("userInfo",$userInfo);
        $this->display();
    }
    
    public function welcome(){
        $this->sysErr("欢迎使用任务系统管理后台");
    }


}
